home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / TSMTE.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  4.8 KB  |  170 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        TSMTE.h
  3.  
  4.      Contains:    Text Services Managerfor TextEdit Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.3
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __TSMTE__
  21. #define __TSMTE__
  22.  
  23.  
  24. #ifndef __TEXTEDIT__
  25. #include <TextEdit.h>
  26. #endif
  27. /*    #include <Types.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <Quickdraw.h>                                        */
  30. /*        #include <MixedMode.h>                                    */
  31. /*        #include <QuickdrawText.h>                                */
  32.  
  33. #ifndef __DIALOGS__
  34. #include <Dialogs.h>
  35. #endif
  36. /*    #include <Errors.h>                                            */
  37. /*    #include <Memory.h>                                            */
  38. /*    #include <Menus.h>                                            */
  39. /*    #include <Controls.h>                                        */
  40. /*    #include <Windows.h>                                        */
  41. /*        #include <Events.h>                                        */
  42. /*            #include <OSUtils.h>                                */
  43.  
  44. #ifndef __APPLEEVENTS__
  45. #include <AppleEvents.h>
  46. #endif
  47. /*    #include <EPPC.h>                                            */
  48. /*        #include <AppleTalk.h>                                    */
  49. /*        #include <Files.h>                                        */
  50. /*            #include <Finder.h>                                    */
  51. /*        #include <PPCToolbox.h>                                    */
  52. /*        #include <Processes.h>                                    */
  53. /*    #include <Notification.h>                                    */
  54.  
  55. #ifndef __TEXTSERVICES__
  56. #include <TextServices.h>
  57. #endif
  58. /*    #include <Components.h>                                        */
  59.  
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63.  
  64. #if PRAGMA_ALIGN_SUPPORTED
  65. #pragma options align=mac68k
  66. #endif
  67.  
  68. #if PRAGMA_IMPORT_SUPPORTED
  69. #pragma import on
  70. #endif
  71.  
  72.  
  73. enum {
  74.     kTSMTESignature                = 'tmTE',
  75.     kTSMTEInterfaceType            = 'tmTE',
  76.     kTSMTEDialog                = 'tmDI'
  77. };
  78.  
  79. /* update flag for TSMTERec*/
  80. enum {
  81.     kTSMTEAutoScroll            = 1
  82. };
  83.  
  84. /* callback procedure definitions*/
  85. typedef pascal void (*TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
  86. typedef pascal void (*TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  87.  
  88. #if GENERATINGCFM
  89. typedef UniversalProcPtr TSMTEPreUpdateUPP;
  90. typedef UniversalProcPtr TSMTEPostUpdateUPP;
  91. #else
  92. typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
  93. typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
  94. #endif
  95.  
  96. struct TSMTERec {
  97.     TEHandle                        textH;
  98.     TSMTEPreUpdateUPP                preUpdateProc;
  99.     TSMTEPostUpdateUPP                postUpdateProc;
  100.     long                            updateFlag;
  101.     long                            refCon;
  102. };
  103. typedef struct TSMTERec TSMTERec, *TSMTERecPtr, **TSMTERecHandle;
  104.  
  105. struct TSMDialogRecord {
  106.     DialogRecord                    fDialog;
  107.     TSMDocumentID                    fDocID;
  108.     TSMTERecHandle                    fTSMTERecH;
  109.     long                            fTSMTERsvd[3];                /* reserved*/
  110. };
  111. typedef struct TSMDialogRecord TSMDialogRecord, *TSMDialogPeek;
  112.  
  113.  
  114. #if GENERATINGCFM
  115. #else
  116. #endif
  117.  
  118. enum {
  119.     uppTSMTEPreUpdateProcInfo = kPascalStackBased
  120.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  121.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  122.     uppTSMTEPostUpdateProcInfo = kPascalStackBased
  123.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  124.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  125.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  126.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  127.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  128.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  129.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long)))
  130. };
  131.  
  132. #if GENERATINGCFM
  133. #define NewTSMTEPreUpdateProc(userRoutine)        \
  134.         (TSMTEPreUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  135. #define NewTSMTEPostUpdateProc(userRoutine)        \
  136.         (TSMTEPostUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  137. #else
  138. #define NewTSMTEPreUpdateProc(userRoutine)        \
  139.         ((TSMTEPreUpdateUPP) (userRoutine))
  140. #define NewTSMTEPostUpdateProc(userRoutine)        \
  141.         ((TSMTEPostUpdateUPP) (userRoutine))
  142. #endif
  143.  
  144. #if GENERATINGCFM
  145. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  146.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  147. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  148.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  149. #else
  150. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  151.         (*(userRoutine))((textH), (refCon))
  152. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  153.         (*(userRoutine))((textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  154. #endif
  155.  
  156.  
  157. #if PRAGMA_IMPORT_SUPPORTED
  158. #pragma import off
  159. #endif
  160.  
  161. #if PRAGMA_ALIGN_SUPPORTED
  162. #pragma options align=reset
  163. #endif
  164.  
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168.  
  169. #endif /* __TSMTE__ */
  170.